package com.mallcai.bigdata.uid.entity;

import com.mallcai.bigdata.uid.worker.WorkerNodeType;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

import lombok.NoArgsConstructor;

/**
 * described :
 * Created by oneape<oneape15@163.com> on 2019-04-04 10:54.
 * Modify:
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class WorkerNode implements Serializable {
    private Long   id;          // Entity unique id (table unique)
    private String hostName;    // CONTAINER: HostName, ACTUAL : IP.
    private String port;        // CONTAINER: Port, ACTUAL: Timestamp + Random(0-10000)
    /**
     * see {@link WorkerNodeType}
     */
    private int    type;        // worker type
    private Long   created;     // created time
    private Long   modified;    // last modified
    private Long   launchTime = System.currentTimeMillis();  // worker node launch date. default now


    public WorkerNode(int type, String hostName, String port) {
        this.type = type;
        this.hostName = hostName;
        this.port = port;
    }
}
